<?php 
require_once 'includes/funciones.php';
conexion();
require_once 'is_login.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title><?php titulo();?></title>
<link rel="STYLESHEET" type="text/css" href="estilo.css">
<link rel="shortcut icon" href="favicon.ico">

<!-- GALERIA -->
<script type="text/javascript" src="plugins/jquery.js"></script>
<script type="text/javascript" src="plugins/jquery-lightbox-0.5/js/jquery.lightbox-0.5.js"></script>
<link rel="stylesheet" type="text/css" href="plugins/jquery-lightbox-0.5/css/jquery.lightbox-0.5.css" media="screen" />

    <script type="text/javascript">
    $(document).ready(function(){	
    	$(function() {
    		$('#classifieds a').lightBox(); // Select all links in object with gallery ID
    		
    	}); 
    });
    </script>

</head>

<body>


<div id="contenedor">

  	<?php
	require_once("includes/encabezado.php");

	?>
  	<!--fin de encabezado-->

<div id="contentleft">

<?php
	include_once("includes/banner.php");
        
?>

	
<div id="contentcenter">
    <div id="socialmedia">        
        <!-- AddThis Button BEGIN -->
			<div class="addthis_toolbox addthis_default_style ">
				<a class="addthis_button_preferred_1"></a>
				<a class="addthis_button_preferred_2"></a>
				<a class="addthis_button_preferred_3"></a>
				<a class="addthis_button_preferred_4"></a>
				<a class="addthis_button_compact"></a>
				<a class="addthis_counter addthis_bubble_style"></a>
			</div>
			<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4e01f0c83b8c3ef4"></script>
			<!-- AddThis Button END -->
			<br/>
    </div>
		


		<?php					
			$subject=sqlint($_GET['subject']);# Limpio la variable por SQLi
			$req=mysql_query("select * from classifieds where id=$subject and is_published= 1");
			
			if(mysql_num_rows($req) != 0){	
					
					$rowclass = mysql_fetch_array($req); 				
					$id_class = $rowclass['id'];
					$categorie=$rowclass['id_categories'];
					$title=$rowclass['title'];
					$description=$rowclass['description'];
					$created=MySQLDateToDate($rowclass['created']);
					$folder=$rowclass['folder'];
					$imagen[1]=$rowclass['imagen1'];
					$imagen[2]=$rowclass['imagen2'];
					$imagen[3]=$rowclass['imagen3'];
					
					
					/*$created=explode(" ", $created);
					
					$date=$created[0];
					$time=$created[1];*/
						
					$rowcategorie=existe("id", "categories", $categorie);
			
				echo '<div id="classifieds">';
					echo '<div class="bannertitulclassifieds">
						
					</div>';
					
					echo '<div class="classbody">';					
						echo '<div class="categoria">';
							echo $rowcategorie['description'];
						echo '</div>';#cierre categoria
						echo '<div class="classtitle">';
							echo '<strong>'.$title.'</strong>';
						echo '</div>';
						echo '<div class=fecha>';
							echo $created;
						echo '</div><br>';	
						echo '<div class="classdescription">';
							echo $description;
						echo '</div>';	
						echo "<br>";
					echo '</div>';	
					
					echo '<div class="classpictures">';
						
						foreach ($imagen as $img){
							if($img!=""){
								
								echo '<a rel="lightbox" href="'.$folder.$img.'">
								<img  src="'.$folder.$img.'" width="72" height="72" alt="" /></a>';
								
							}
						}
					echo '</div>';
				echo "</div>";	
										
				}
			
		else{
			echo '<div class="imagenes"><img src=imagenes/zambo404.JPG></div>';
		}	
?>


</div> <!-- Cierre contentcenter -->


</div> <!-- Cierre contentleft -->
 



<div id="menuderecha" >
	<?php
	include_once("includes/menuderecha.php");
	?>
</div>	


<div id="publicidadbottom">
	<?php 
	include_once 'includes/publicidadbottom.php';	
	?>
</div>


<div id="piepagina">
<?php
include_once 'includes/pie.php';
?>
</div> 
  
  
  
  
</div> <!--fin de Contenedor-->


</body>
</html>
